package kr.pe.johnkim.checkmileage.mobile.rest.service;

import kr.pe.johnkim.checkmileage.mobile.domain.CheckMileageMerchantMarketing;
import kr.pe.johnkim.checkmileage.mobile.rest.dao.CheckMileageMerchantMarketingDao;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * Check Mileage 마케팅 관련 Service 기능들을 구현하는 클래스 이다.
 *
 * @author : johnkim <cale9797@gmail.com / Bettersoft, Inc.>
 * @date: 12. 10. 20.
 */
public class CheckMileageMerchantMarketingServiceImpl implements CheckMileageMerchantMarketingService {

    // SLF4J Logging
    private Logger logger = LoggerFactory.getLogger(CheckMileageMerchantMarketingServiceImpl.class);

    @Autowired
    private CheckMileageMerchantMarketingDao checkMileageMerchantMarketingDao = null;

    /**
     * 마케팅을 등록 한다.
     *
     * @param checkMileageMerchantMarketing
     */
    @Override
    public void registerMarketing(CheckMileageMerchantMarketing checkMileageMerchantMarketing) {
        logger.info("registerMarketing");

        checkMileageMerchantMarketingDao.registerMarketing(checkMileageMerchantMarketing);
    }

    /**
     * 마케팅을 업데이트 한다.
     *
     * @param checkMileageMerchantMarketing
     */
    @Override
    public void updateMarketing(CheckMileageMerchantMarketing checkMileageMerchantMarketing) {
        logger.info("updateMarketing");

        checkMileageMerchantMarketingDao.updateMarketing(checkMileageMerchantMarketing);
    }

    /**
     * 마케팅 목록을 가져 온다. 사용자 smart phone 에 출력.
     *
     * @param checkMileageMerchantMarketing
     * @return
     */
    @Override
    public List<CheckMileageMerchantMarketing> selectMemberMerchantMarketingList(CheckMileageMerchantMarketing checkMileageMerchantMarketing) {
        logger.info("selectMemberMerchantMarketingList");

        return checkMileageMerchantMarketingDao.selectMemberMerchantMarketingList(checkMileageMerchantMarketing);
    }

    /**
     * 마케팅 목록을 가져 온다. 가맹점 iPad/Web site 에 출력.
     *
     * @param checkMileageMerchantMarketing
     * @return
     */
    @Override
    public List<CheckMileageMerchantMarketing> selectMerchantMemberMarketingList(CheckMileageMerchantMarketing checkMileageMerchantMarketing) {
        logger.info("selectMerchantMemberMarketingList");

        return checkMileageMerchantMarketingDao.selectMerchantMemberMarketingList(checkMileageMerchantMarketing);
    }

    /**
     * 마케팅을 비활성화 한다.
     *
     * @param checkMileageMerchantMarketing
     */
    @Override
    public void updateDeactivateMarketing(CheckMileageMerchantMarketing checkMileageMerchantMarketing) {
        logger.info("updateDeactivateMarketing");

        checkMileageMerchantMarketingDao.updateDeactivateMarketing(checkMileageMerchantMarketing);
    }
}
